﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace TC
{
    [Menu("Test/AListNode")]
    [Description("I am ListNode, just to show u the editor can show List, and can dynamically add ports.")]
    public class ListNode : FunctionNode
    {
        private ValueInput<Vector3> vec;
        private ValueOutput<int> num;
        [InputGroup]
        private List<ValueInput<int>> number = new List<ValueInput<int>>();
        [InputGroup]
        private List<FlowInput<FlowNode>> ins = new List<FlowInput<FlowNode>>();
        [OutputGroup]
        private List<FlowOutput<FlowNode>> outs = new List<FlowOutput<FlowNode>>();
        private ValueInput<List<int>> listIns;
 
        public override void OnCreate()
        {
            base.OnCreate();
            vec = AddValueInPort<Vector3>("vec");
            num = AddValueOutPort("num", () => 1);

            number.Add(AddValueInPort<int>("number0"));
            ins.Add(AddFlowInPort<FlowNode>("ins0"));

            outs.Add(AddFlowOutPort<FlowNode>("out0"));

            listIns = AddValueInPort<List<int>>("listIns");
        }
    }
}
